--- id: TASK-012 title: Editing polish bundle status: "\U0001F3C1 Done" assignee: [] created_date: '2026-06-29 16:26' updated_date: '2026-06-30 00:11' labels: - feature - release-1 dependencies: [] priority: low ordinal: 12000 --- ## Description Release 1 (can be split). Smaller niceties: (a) auto-close pairs — typing '[','(','backtick' inserts the closing char with the cursor inside; typing the closing char over an auto-inserted one steps over it; (b) smart Home — first press goes to the first non-whitespace column, second to column 0; (c) go-to-line command/prompt; (d) remember cursor position per file within a session (reopening returns to it); (e) paste a URL over a selection -> [selection](url). ## Acceptance Criteria - [x] #1 Auto-close pairs for [] () and backticks (with step-over) - [x] #2 Smart Home (first non-blank, then col 0) - [x] #3 Go-to-line; per-file cursor memory; paste-URL-over-selection ## Implementation Plan Editor-level (TDD in internal/editor): - AC1 auto-close: dispatch KeyRunes, no selection + single open rune (,[,backtick -> insertPair(open,close,1). Closing rune )/]/backtick with same char right of cursor -> step over (MoveRight). New autoClose(r) helper + TypeRune wrapper. - AC2 smart Home: MoveHome -> toggle first-non-blank <-> col 0. App-level (TDD in internal/app): - AC3 go-to-line: ModeGotoLine + Ctrl+L prompt, editor.GotoLine(n) clamp; gotoBar; Esc closes. - AC3 per-file cursor memory: App cursorMem map[path]Position; Load saves leaving file, restores on return; editor.SetCursor clamps. - AC3 paste-URL-over-selection: paste() -> if HasSelection && isURL(clip) -> [sel](url). ## Implementation Notes Editor (TDD, internal/editor/polish_test.go): auto-close pairs () [] backtick via typeRune in dispatch (no-selection single rune), insertPair reused; closer steps over a matching char to the right. Smart Home toggles first-non-blank <-> col 0. Added GotoLine + SetCursor (clamped). App (TDD, internal/app/polish_test.go): Ctrl+L -> ModeGotoLine prompt (digits-only, Enter jumps, Esc cancels); per-file cursor memory map restored on Load; pasteText wraps a URL pasted over a selection as [sel](url), else verbatim. Docs: help.go EDITING section + Ctrl+L; README keys. Full suite + vet green.